import http from '@/api/http'

// 获取院校结构
const getStructure = (data) => {
    return http({
        url: "work/structure",
        method: "get",
        params: data
    })
}

// 点赞/踩
const handlePl = (data) => {
    return http({
        url: "work/iszan",
        method: "post",
        data: data
    })
}

// 撤回评论 (删除)
const delComment = (data) => {
    return http({
        url: "work/delComment",
        method: "get",
        params: data
    })
}




// 退出登陆
const signOut = (data) => {
    return http({
        url: "user/signOut",
        method: "post",
        data: data
    })
}

// 找回密码
const handlePassword = (data) => {
    return http({
        url: "user/getpassword",
        method: "post",
        data: data
    })
}


// register
const register = (data) => {
    return http({
        url: "user/register",
        method: "post",
        data
    })
}


// 登陆
const getLogin = (data) => {
    return http({
        url: "user/login",
        method: "get",
        params: data
    })
}

// 获取yzm
const getMail = (data) => {
    return http({
        url: `user/postmail`,
        method: "get",
        params: data
    })
}

// 上传就业人员信息
const uploadInfo = (data) => {
    return http({
        url: `work/uploadInfo`,
        method: "post",
        data: data
    })
}

// 修改用户信息---老师
const putHeaderImg = (data) => {
    return http({
        url: "work/putInfoTeacher",
        method: "post",
        data,
    })
}

// 修改用户信息---学生
const putStudentInfo = (data) => {
    return http({
        url: "work/putInfoStudent",
        method: "post",
        data,
    })
}


// 获取所有老师需要审核的信息
const getAllMidels = (data) => {
    return http({
        url: "work/getallmiddleinfo",
        method: "get",
        params: data,
    })
}


// 通过了审核
const putPass = (data) => {
    return http({
        url: "work/pass",
        method: "post",
        data: data,
    })
}

// 没通过审核
const putNoPass = (data) => {
    return http({
        url: "work/nopass",
        method: "post",
        data: data,
    })
}

// 获取全部的就业学员的表格
const getallStudentForm = (data) => {
    return http({
        url: "work/getallStudentForm",
        method: "get",
        params: data,
    })
}

// 条件搜索
const filterForms = (data) => {
    return http({
        url: "work/filterStudentForms",
        method: "get",
        params: data,
    })
}

// 获取echarts数据
const filterEcharts = (data) => {
    return http({
        url: "work/echarts",
        method: "get",
        params: data,
    })
}


// 获取全部评论
const getallcomments = (data) => {
    return http({
        url: "work/allcomments",
        method: "get",
        params: data,
    })
}

// 发送评论
const sendComent = (data) => {
    return http({
        url: "work/addComment",
        method: "post",
        data: data
    })
}

// 获取毕业学历结构百分比
const sendEchartsStructure = (data) => {
    return http({
        url: "work/echartsstructure",
        method: "get",
        params: data
    })
}


// 获取性别下的毕业学历结构
const sendSexstract = (data) => {
    return http({
        url: "work/sexstract",
        method: "get",
        params: data
    })
}

// 地图echarts
const sendEchartsMap = (data) => {
    return http({
        url: "work/echartsmap",
        method: "get",
        params: data
    })
}

// 获取 老师或者学生的路由权限列表
const getClassJur = (data) => {
    return http({
        url: "user/getClassJur",
        method: "get",
        params: data
    })
}

// 获取 老师或者学生的路由权限列表
const updataClassJur = (data) => {
    return http({
        url: "user/updataClassJur",
        method: "post",
        data
    })
}

// 获取 老师或者学生的路由权限列表
const getUsers = (data) => {
    return http({
        url: "user/getusers",
        method: "get",
        params: data
    })
}

// 获取 老师或者学生的路由权限列表
const updataUserJur = (data) => {
    return http({
        url: "user/updataUserJur",
        method: "post",
        data
    })
}

// admin 提交修改后的用户信息

const updataUserData = (data) => {
    return http({
        url: "user/updataUserData",
        method: "post",
        data
    })
}

//admin用户直接注册新用户
const adminRegisterUser = (data) => {
    return http({
        url: "user/adminRegisterUser",
        method: "post",
        data
    })
}

// 用户修改头像
const updataUserHeader = (data) => {
    return http({
        url: "user/updataUserHeader",
        method: "post",
        data
    })
}

// 获取学院毕业升学信息
const getAllCollegeData = (data) => {
    return http({
        url: "work/getAllCollegeData",
        method: "get",
        params: data
    })
}

// 获取专业毕业升学信息
const getAllMajorData = (data) => {
    return http({
        url: "work/getAllMajorData",
        method: "get",
        params: data
    })
}

export {
    getAllMajorData,
    getAllCollegeData,
    updataUserHeader,
    register,
    adminRegisterUser,
    updataUserData,
    updataUserJur,
    getUsers,
    updataClassJur,
    getClassJur,
    sendEchartsMap,
    sendSexstract,
    sendEchartsStructure,
    getallcomments,
    filterEcharts,
    filterForms,
    getallStudentForm,
    putNoPass,
    putPass,
    getAllMidels,
    putStudentInfo,
    putHeaderImg,
    uploadInfo,
    getMail,
    getLogin,
    handlePassword,
    signOut,
    sendComent,
    delComment,
    handlePl,
    getStructure
}






